Release 10.1A: OpenEdge Development:
Progress 4GL Reference
PUT-BYTE statement
Stores the unsigned 1-byte value of an INTEGER expression at the specified memory location.
Syntax
destinationA variable of type RAW or MEMPTR. If
destinationis the Unknown value (?), it remains the Unknown value (?). Ifdestinationis a MEMPTR and has not had its region allocated (by a SET-SIZE statement or by a Windows dynamic link library (DLL) or UNIX shared library routine), Progress generates a run-time error.positionAn INTEGER value greater than 0 that indicates the byte position where Progress stores
expression. Ifpositionis less than 1, Progress generates a run-time error. For a RAWdestination, ifpositionis greater than the length ofdestination, Progress changes the length ofdestinationtopositionand pads the gap with null bytes. For a MEMPTRdestination, ifpositionis greater than the length ofdestination, Progress generates a run-time error.expressionThe INTEGER value of a constant, field, variable, function, or expression. If
Examplesexpressionis less than 0 or greater than 255, Progress stores the right-most byte value ofexpressionindestination.This procedure finds the name of customer 26, Jack’s Jacks, and stores it in the RAW variable r1. The PUT-BYTE statement replaces the first four bytes in the name with the specified character code values. The procedure then writes the values in r1 back into the name field and displays that field. Jack’s Jacks becomes Bill’s Jacks.
The following example allocates a MEMPTR region large enough to hold the character string “Bill”, terminated by a null byte. It stores the string one byte at a time using the PUT-BYTE statement, and then displays the string directly from the region.
Note
For more information on accessing DLL routines from Progress, see OpenEdge Development: Programming Interfaces .
See also
GET-BYTE function, LENGTH function, LENGTH statement, RAW function, RAW statement, SET-SIZE statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |